Telegram Group & Telegram Channel
Статические методы

Отличие статического метода от обычного метода класса в том, что первый привязан к классу, а не объекту.

Такой тип методов по умолчанию не принимает ни объект, ни класс – прописывать self или cls в аргументах не нужно. То есть статические методы не могут модифицировать ни объект, ни сам класс.

Обычную функцию стоит вносить в класс в качестве статического метода в том случае, когда эта функция логически относится к классу и имеет смысл там быть.

Подписывайтесь на канал 👉@pythonofff



tg-me.com/pythonofff/2973
Create:
Last Update:

Статические методы

Отличие статического метода от обычного метода класса в том, что первый привязан к классу, а не объекту.

Такой тип методов по умолчанию не принимает ни объект, ни класс – прописывать self или cls в аргументах не нужно. То есть статические методы не могут модифицировать ни объект, ни сам класс.

Обычную функцию стоит вносить в класс в качестве статического метода в том случае, когда эта функция логически относится к классу и имеет смысл там быть.

Подписывайтесь на канал 👉@pythonofff

BY Python академия




Share with your friend now:
tg-me.com/pythonofff/2973

View MORE
Open in Telegram


Python академия Telegram | DID YOU KNOW?

Date: |

That strategy is the acquisition of a value-priced company by a growth company. Using the growth company's higher-priced stock for the acquisition can produce outsized revenue and earnings growth. Even better is the use of cash, particularly in a growth period when financial aggressiveness is accepted and even positively viewed.he key public rationale behind this strategy is synergy - the 1+1=3 view. In many cases, synergy does occur and is valuable. However, in other cases, particularly as the strategy gains popularity, it doesn't. Joining two different organizations, workforces and cultures is a challenge. Simply putting two separate organizations together necessarily creates disruptions and conflicts that can undermine both operations.

Tata Power whose core business is to generate, transmit and distribute electricity has made no money to investors in the last one decade. That is a big blunder considering it is one of the largest power generation companies in the country. One of the reasons is the company's huge debt levels which stood at ₹43,559 crore at the end of March 2021 compared to the company’s market capitalisation of ₹44,447 crore.

Python академия from no


Telegram Python академия
FROM USA